/*
 *  $Id: Fear.cs 975 2009-12-16 17:13:22Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Affects {
    /// <summary>
    /// Эффект: страх
    /// Параметр: максимальное здоровье для действия страха
    /// Существо не может нанести урон, пока у него здоровье ниже указанного значения.
    /// </summary>
    public class Fear: Affect {
        public readonly int Value;

        public Fear(int value) {
            Value = value;
        }

        public override string Id {
            get { return "fear"; }
        }
        public override string NameText {
            get { return Name.GetText(Value); }
        }

        public override int BaseWeight {
            get { return Value * -10; }
        }

        public override AffectIcon Icon {
            get { return AffectIcon.Fear; }
        }

        public override Affect Clone() {
            return new Fear(Value);
        }

        public override void SetAffect() {
            base.SetAffect();
            LocalSummary.Fear.Add(this);
        }
        public override void ResetAffect() {
            base.ResetAffect();
            LocalSummary.Fear.Remove(this);
        }

        public static int Comparison(Fear a, Fear b) {
            return a.Value.CompareTo(b.Value);
        }
    }
}